home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / rexx / deliplay.dopus5 < prev    next >
Text File  |  1996-06-10  |  7KB  |  192 lines

  1. /* Mod-Player V2.00 [10-Juni-1996] for Directory Opus 5.
  2.    By Leo Davidson ("Nudel", P0T-NOoDLE/Gods'Gift Utilities)
  3.  
  4.    Revision by Helmut Hummel("Delta Soft") EMail: hhummel@t-online.de
  5.  
  6.    Änderung - Dateien als Liste an DeliTracker übergeben !!!
  7.  
  8.    English
  9.    Some better:    The DeliTracker begins not to play his program,
  10.                    he starts with the 1st selected module and the
  11.                    script is running in async mode.
  12.  
  13.                    The Delitracker will find his configuration file.
  14.  
  15.                    The modules will all deselected.
  16.    to install-help read the lines around the stars (*)
  17.    But it's always "Nudel's" program.
  18.  
  19.    Deutsch
  20.    Verbesserungen: Die Titel werden sofort mit dem DeliTracker abgespielt,
  21.                    nicht erst nach Laden des Moduleprogramms.
  22.  
  23.                    Der DeliTracker findet sein Configurations-File.
  24.  
  25.                    Die Titel werden alle sofort deselektiert.
  26.    Allerdings bleibt es "Nudel's" Programm.
  27. -----------------------------------------------------------------------------
  28.  
  29. Call as:
  30. ARexx   DOpus5:ARexx/DeliPlay.dopus5 {Qp} {f}
  31.  
  32. ------------------------------------------------------------------------------
  33. RUN asynchron. (!!!)
  34. Create a config for DeliTracker in DOpus5:Settings with hide mode and other
  35. settings you wish (Demo-Config in archive included, copy to DOpus:Settings)
  36. *****************************************************************************
  37.  
  38. - Path to DeliTracker command (edit the follow line[s] to your settings)    */
  39.  
  40. Delipath    = "dh2:systemtools/moduleplayer/delitracker_II"
  41.  
  42. /****************************************************************************/
  43.  
  44. DeliTracker = "run Delitracker2 CONFIG DOPUS5:Settings/DeliTracker.config CX_POPUP NO "
  45.  
  46. /* Start-Command (don't remove the space at end !!! - used to append delilist)
  47.  
  48. Note for english: If only one mod is selected, no requester appears.
  49.                   In this case use DeliStop.rexx to stop the DeliTracker
  50.  *--------------------------------------------------------------------------*/
  51.  
  52. options results
  53. options failat 99
  54. signal on ioerr
  55.  
  56. Quit_After = "NO" 
  57.  
  58. parse arg DOpusPort FilePath
  59.  
  60. DOpusPort = Strip(Strip(DOpusPort,"B"," "),"B",'"')
  61. FilePath = Strip(Strip(FilePath,"B",' '),"B", '"')
  62. If DOpusPort = "" then
  63.      Do
  64.         Say "Not correctly called from Directory Opus 5!"
  65.         Say "Load this ARexx script into editor for more info."
  66.         EXIT
  67.      END
  68.  
  69. /* If only one mod selected, just play that mod, else load all mods
  70.    into the DeliTracker-List and begin to play.                           */
  71.  
  72.  
  73. Address VALUE DOpusPort
  74.         
  75.         lister query source
  76.         Lister_Handle = result
  77.         lister query Lister_Handle path
  78.         Lister_Path = strip(result, "B", '"')
  79.         lister query Lister_Handle selfiles
  80.         Dateien = result
  81.         lister query Lister_Handle numselentries
  82.         Lister_NumSelEnt = result
  83.  
  84.         if Lister_NumSelEnt <= 0 then do      /* doubleclick or only 1 mod */
  85.            If ~Show("P", "DELITRACKER") Then  /* Delitracker is not running*/
  86.                call OpenDeli(FilePath)
  87.            else do
  88.              Address DELITRACKER              /* Delitracker is running    */
  89.              PlayMod FilePath
  90.            end
  91.            EXIT
  92.         end
  93.         position = 1
  94.         call Open('programm', 't:deliplay.temp', 'w')
  95.         if result = 0 then call ioerr
  96.         call writeln('programm', 'MODLIST')
  97.         call writeln('programm', FilePath)
  98.  
  99.         if Lister_NumSelEnt > 0 then do
  100.            call MakeList
  101.  
  102.            writech('programm', Lister_Path)
  103.            call substr(Dateien, position)
  104.            call strip(result, 'B', '"')
  105.            datei = result
  106.            writeln('programm', datei)
  107.            lister select Lister_Handle '"'datei'"' off
  108.            lister refresh Lister_Handle
  109.         end
  110.         Close('programm')
  111.      If ~Show("P", "DELITRACKER") Then
  112.               call OpenDeli("T:deliplay.temp")
  113.      else do
  114.              Address DELITRACKER
  115.              PlayMod 'T:deliplay.temp'
  116.           end
  117.      Address DELITRACKER
  118.      'status m max'
  119.      count = result
  120.      do forever
  121.         'status m fmt'
  122.         format=result
  123.         'status m fil'
  124.         Temp_Name = result
  125.         'status m nam'
  126.         Int_Name = result
  127.         'status m num'
  128.         counter = result
  129.         address VALUE DOpusPort
  130.         select
  131.         when counter = 1 then do
  132.              dopus request '"Spiele Modul ' counter ' von ' count ':'||X2C(0A)||'Dos-Name : 'Temp_Name||X2C(0A)||' Interner Name :' Int_Name||X2C(0A)' Format: 'format' " Nächstes|Laufen lassen|Stop'
  133.              erg = rc
  134.              if erg ~=0 then erg = erg + 2
  135.              end
  136.         when counter = count then do
  137.              dopus request '"Spiele Modul ' counter ' von ' count ':'||X2C(0A)||'Dos-Name : 'Temp_Name||X2C(0A)||' Interner Name :' Int_Name||X2C(0A)' Format: 'format' " Voriges|Laufen lassen|Stop'
  138.              erg = rc
  139.              erg = erg * 2
  140.              end
  141.         otherwise
  142.              dopus request '"Spiele Modul ' counter ' von ' count ':'||X2C(0A)||'Dos-Name : 'Temp_Name||X2C(0A)||' Interner Name :' Int_Name||X2C(0A)' Format: 'format' " Voriges|Nächstes|Laufen lassen|Stop'
  143.              erg = rc
  144.              if erg ~= 0 then erg = erg + 1
  145.         end
  146.         address DELITRACKER
  147.         if erg = 0 then 'quit'
  148.         if erg = 2 then 'prevsong'
  149.         if erg = 3 then 'nextsong'
  150.         if erg = 4 then leave
  151.      end
  152.      Address Command
  153.      'delete T:deliplay.temp all quiet force'
  154.      EXIT
  155.  
  156. /*=========================== Sub-routines =========================*/
  157.  
  158. MakeList:
  159.         do j=1 to Lister_NumSelEnt - 1
  160.                  writech('programm', Lister_Path)
  161.                  call index(Dateien, '" "', position)
  162.                  position2 = result
  163.                  call substr(Dateien, position, position2 - position)
  164.                  call strip(result, "B", '"')
  165.                  datei = result
  166.                  writeln('programm', datei)
  167.                  lister select Lister_Handle '"'datei'"' off
  168.                  lister refresh Lister_Handle
  169.                  position = position2 + 3
  170.         end
  171.         return
  172. /*--------------------------------------------------------------------*/
  173. WARNING:
  174.         dopus request '"Du mußt einen SOURCE-Lister haben oder einen Pfad übergeben!" OK'
  175.         address DELITRACKER quit
  176.         EXIT
  177. /*--------------------------------------------------------------------*/
  178. OpenDeli:
  179.         PARSE ARG STARTMOD
  180.         pragma('D', DeliPath)
  181.         address command DeliTracker||"module "||'"'STARTMOD'"'
  182.         Quit_After = "YES"
  183.         TickTick = Time(M)
  184.         Do While ~Show("P","DELITRACKER")
  185.            IF Time(M) - TickTick > 0 Then Do
  186.                    dopus request '"Fehler beim Laden des DeliTracker!'||X2C(0A)||'Prüfe bitte den Pfad im ARexx script." OK'
  187.                    EXIT
  188.               END
  189.         END
  190.         RETURN
  191. /*====================================================================*/
  192.